import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

/**
 * 路由结构说明
 * 默认创建登录，修改密码，主页路由, 其他路由根据后台返回字段动态添加路由，动态路由结构见school.js, 权限判断入口handle.js
 * 修改本地模拟数据接口/net/admin/get, params: pid 0(管理员), netType 表示系统类型
 */
const defaultRoutes = [
  {
    path: '/login',
    name: 'login',
    component: resolve => {
      require(['src/views/login/index'], resolve)
    },
    meta: {
      title: '登录'
    },
    hidden: true
  },
  {
    path: '/change-password',
    name: 'changePassword',
    component: resolve => {
      require(['src/views/login/changePass'], resolve)
    },
    meta: {
      title: '修改密码'
    },
    hidden: true
  },
  {
    path: '/',
    name: 'home',
    component: resolve => {
      require(['src/views/home/index'], resolve)
    },
    meta: {
      title: '主页'
    },
    hidden: true
  }
]

export default new VueRouter({
  mode: 'history',
  routes: defaultRoutes
})
